<template>
    <h1>登录页面</h1>

    <table>
        <tr>
            <td>用户名</td>
            <td>
                <input type="text" v-model="Name" >
            </td>
        </tr>

        <tr>
            <td>密码</td>
            <td>
                <input type="psseword" v-model="Pwd" >
            </td>
        </tr>

        <tr>
            <td colspan="2">
                <input type="button" value="登录" @click="login" >
            </td>
        </tr>

    </table>

</template>

<script setup lang="ts">
import { useRouter }  from 'vue-router';
import {ref} from 'vue';

const Router = useRouter();
const Name=ref('');
const Pwd = ref('');

const login=  ()=>{
    if(Name.value==''){
        alert("用户名不能为空");
        return;
    }
    if(Pwd.value==''){
        alert("密码不能为空");
        return;
    }
    if(Name.value=='Admin123' && Pwd.value=='Admin123'){
        alert("登录成功");

    }
}


console.log(Router)

</script>
